<%@page import="java.util.List"%>
<%@page import="org.apache.jasper.tagplugins.jstl.core.ForEach"%>
<%@page import="java.util.ArrayList"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<%@page import="org.apache.catalina.Session"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.lang.String"%>
<%@page import="com.stx.model.RegisterBlogModel"%>
<%@page import="com.stx.sql.SqlQuery"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>五人行博客登录</title>
<link href="css/css.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
	function check() {
		if (document.login.username.value == "") {
			alert("请输入登录名");
			return false;
		} else if (document.login.password.value == "") {
			alert("请输入密码");
			return false;
		}
		return true;
	}
</script>

<script src="lib/jquery.js" type="text/javascript"></script>

</head>
<body>
	<img src="img/bg.jpg" id="bgimage" />
	<div id="all">
		<div id="header"></div>
		<div id="allblog">
			<ul id="allblog-blog" >
				<%
					RegisterBlogModel registerBlogModel = new RegisterBlogModel();
					SqlQuery sqlQuery = new SqlQuery();

					ResultSet rs = sqlQuery.readAllBlogSql(registerBlogModel);
				%>
				<%
					while (rs.next()) {
				%>

				<li>
					<ul id="oneblog">
						<li>
						<div id="timeleft">博文：<%=rs.getString("title")%></div>
						<div id="timeright">博文分类：<%=rs.getString("blogtype")%></div></li>
						<li id="blogcontent">
						<div id="blogcontent2"><%=rs.getString("blogcontent")%></div></li>
						<li id="timepage">
							<div id="timeleft">用户ID：<%=rs.getString("u_id") %></div> 
							<div id="timeright">博文更新时间<%=rs.getString("timepage") %></div>
						</li>
						
					</ul>


				</li>
				<%
					}
				%>
			</ul>
		</div>
		<div id="login">
			<form action="loginServlet" method="post" id="myform" name="login">
				<p>
					登录名:<input type="text" name="username" id="username" />
				<p>
					密&nbsp;&nbsp;&nbsp;&nbsp;码:<input type="password" name="password"
						id="password" /><input type="checkbox" name="remenberpassword"
						value="remenberpassword" />记住密码 <input type="checkbox"
						name="autologin" value="autologin" />自动登录 <br /> <input
						type="submit" value="登录"> |<a href="register2.html"><span
						style="font-size: 1.2em">注册</span></a>
			</form>
		</div>

	</div>
</body>
</html>